<template>
	<view class="assetMang">
		<view class="app-title ac">
			<view class="fl" @click="back">
				<image class="back" src="/static/img/back.png"></image>
			</view>图纸管理
		</view>
		<web-view v-if="url" ref="webView" class="webViewClass" :webview-styles="webviewStyles" :src="url"
			@message="getMessage"></web-view>
	</view>
</template>
<script>
	import {
		WORK_CONTROLLER
	} from "../../api/pms";

	export default {
		data() {
			return {
				webviewStyles: {
					top: '66px'
				},
				curWebview: null,
				// url: '/hybrid/html/assMang.html'
				url: "",
				// url: 'http://125.46.10.66:9974/webroot/decision/url/mobile/packagedApp/?appId=d902359e-8d3f-109b-f638-fd561caafe81&fine_username=admin'

			}
		},
		computed: {

		},
		watch: {},
		onReady() {},
		onLoad(options) {},
		onUnload() {

		},
		async mounted() {
			await this.getUrl()
			// #ifdef H5

			// #endif
			// #ifdef APP-PLUS
			let _this = this
			uni.getSystemInfo({
				success(res) {
					console.log(res) //手机牌子
					console.log(res.model) //手机型号
					console.log(res.screenWidth) //屏幕宽度
					console.log(res.screenHeight) //屏幕高度
					let height = res.screenHeight
					let windownHeight = res.windowHeight
					let childHeight = windownHeight - 66
					setTimeout(() => {
						_this.curWebview = _this.$scope.$getAppWebview().children()[0]
						_this.curWebview.setStyle({
							height: childHeight + 'px'
							// height: "200px"
						})
						console.log("页面高度", childHeight + 'px', _this.curWebview.setStyle)
					}, 1000)

				}
			})


			// #endif
		},
		methods: {
			getUrl() {
				this.fetch(
					"GET",
					this.$store.state.baseUrl + '/DocData/getFanRuanDocManagementURL', {}, false
				).then((res) => {
					if (res?.success) {
						this.url = `${res.data}&tempTime=${new Date().getTime()}`
					} else {

					}
				})
			},
			passMessage(param) {
			},
			back() {
				uni.redirectTo({
					url: "/pages/index/index"
				})
			},
		}
	}
</script>

<style lang="less" scoped>
	.assetMang {}

	.webViewClass {
		height: calc(100vh - 66px);
		width: 100vw;
		top: 66px !important;
		padding-bottom: var(--window-bottom);
	}
</style>
<style>
	* {
		/* 取消点击背景色显示蓝色 */
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
	}
</style>